﻿<navigation:Page x:Class="HelfenHelfen.RIA.Views.DemandList" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="DemandList Page" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:HelfenHelfen.RIA.Web.Models" xmlns:my1="clr-namespace:HelfenHelfen.RIA.Web.Services" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:my2="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="226*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="30" />
            <RowDefinition Height="200*" />
        </Grid.RowDefinitions>
        <riaControls:DomainDataSource AutoLoad="True" d:DataContext="{d:DesignInstance my:Demand, CreateList=true}" Height="0" LoadedData="demandDomainDataSource_LoadedData" Name="demandDomainDataSource" QueryName="GetDemandsQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my1:HelfenHelfenDomainContext />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        <sdk:DataGrid AutoGenerateColumns="False" Grid.Row="0"
                      ItemsSource="{Binding ElementName=demandDomainDataSource, Path=Data}" Name="demandDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected"
                      SelectionChanged="demandDataGrid_SelectionChanged">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTemplateColumn CanUserReorder="True" CanUserResize="False" CanUserSort="False" Width="Auto" >
                    <sdk:DataGridTemplateColumn.CellTemplate >
                        <DataTemplate>
                            <Button x:Name="btnDetails" Content="Details..." Click="btnDetails_Click" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTextColumn x:Name="titleColumn" Binding="{Binding Path=Title}" Header="Title" Width="*" />
                <sdk:DataGridTextColumn x:Name="postalCodeColumn" Binding="{Binding Path=PostalCode}" Header="PO Code" Width="SizeToHeader" />
                <sdk:DataGridTextColumn x:Name="cityColumn" Binding="{Binding Path=City}" Header="City" Width="SizeToCells" />
                <sdk:DataGridTemplateColumn x:Name="startDateTimeColumn" Header="Start Date Time" Width="SizeToHeader">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <sdk:DatePicker SelectedDate="{Binding Path=StartDateTime, Mode=TwoWay, NotifyOnValidationError=true}" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn x:Name="endDateTimeColumn" Header="End Date Time" Width="SizeToHeader">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <sdk:DatePicker SelectedDate="{Binding Path=EndDateTime, Mode=TwoWay, NotifyOnValidationError=true}" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
        <controlsToolkit:BusyIndicator Grid.Row="0" Height="84" HorizontalAlignment="Left" Margin="252,169,0,0" Name="busyIndicator1" VerticalAlignment="Top" Width="173" IsBusy="{Binding ElementName=demandDomainDataSource, Path=DomainContext.IsLoading}" />
        <sdk:DataPager Grid.Row="1" Name="dataPager1" Source="{Binding ElementName=demandDomainDataSource, Path=Data}" PageSize="5" />
        <Button Content="Save ..." Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="0,7,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
        <my2:Map Grid.Row="3" Name="map1" Margin="10" LogoVisibility="Collapsed" />
    </Grid>
</navigation:Page>
